<!DOCTYPE html>
<html>

<head>
    <title>图片预加载</title>
    <meta charset="utf-8" />
    <link rel="shortcut icon" type="image/png" href="../Scripts/jasmine-standalone-3.1.0/lib/jasmine-3.1.0/jasmine_favicon.png">

    <link rel="stylesheet" href="../Scripts/plugIn/jquery-ui-1.10.4.custom/css/base/jquery-ui-1.10.4.custom.css">
    <link rel="stylesheet" href="../Scripts/jasmine-standalone-3.1.0/lib/jasmine-3.1.0/jasmine.css">
    <script src="../Scripts/plugIn/jquery-ui-1.10.4.custom/js/jquery-1.10.2.js"></script>
    <script src="../Scripts/plugIn/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js"></script>
    <script src="../Scripts/jasmine-standalone-3.1.0/lib/jasmine-3.1.0/jasmine.js"></script>
    <script src="../Scripts/jasmine-standalone-3.1.0/lib/jasmine-3.1.0/jasmine-html.js"></script>
    <script src="../Scripts/jasmine-standalone-3.1.0/lib/jasmine-3.1.0/boot.js"></script>
    <script src="../Scripts/jasmine-standalone-3.1.0/lib/jasmine-3.1.0/jasmine-matchers.js"></script>
    <!-- include tools files here... -->
    <script src="../Scripts/myTool/pattern/createObject/namespace.js"></script>
    <script src="../Scripts/myTool/frame/YOOP.js"></script>
    <!--配置信息-->
    <script src="../Scripts/config.js"></script>
    <!--Extend-->
    <script src="../Scripts/myTool/extend/object_extend.js"></script>
    <!--Tool-->
    <script src="../Scripts/myTool/tool/jsObject/func.js"></script>
    <script src="../Scripts/myTool/tool/jsObject/array.js"></script>
    <script src="../Scripts/myTool/tool/asyn/asyn.js"></script>
    <script src="../Scripts/myTool/tool/type/judge.js"></script>
    <script src="../Scripts/myTool/tool/codeReuse/extend.js"></script>
    <script src="../Scripts/myTool/tool/event/event.js"></script>
    <script src="../Scripts/myTool/tool/game/collision.js"></script>

    <!--Control-->
    <script src="../Scripts/myTool/control/image/PreLoadImg.js"></script>
    <script src="../Scripts/bomber/component/Bitmap.js"></script>
    <script src="../Scripts/bomber/factory/bitmapFactory.js"></script>

    <!-- include spec files here... -->
    <script src="../Scripts/jasmine-standalone-3.1.0/spec/component/BitmapSpec.js"></script>
    <script src="../Scripts/jasmine-standalone-3.1.0/spec/component/BitmapSpec.js"></script>
</head>

<body>
    <div id="progress"></div>
    <div id="result"></div>
    <script type="text/javascript">
        (function () {
            //图片预加载
            main.init()

            //清除“main.init()”创建的多余html元素
            function clear() {
                $("body").children().not("script").remove();
            };

            var jasmineEnv = jasmine.getEnv();
            jasmineEnv.updateInterval = 1000;

            var htmlReporter = new jasmine.HtmlReporter();

            jasmineEnv.addReporter(htmlReporter);

            jasmineEnv.specFilter = function (spec) {
                return htmlReporter.specFilter(spec);
            };

            var currentWindowOnload = window.onload;

            //延迟300ms执行测试（等待预加载完后执行）
            setTimeout(function () {
                clear();

                if (currentWindowOnload) {
                    currentWindowOnload();
                }
                execJasmine();
            }, 1000);

            function execJasmine() {
                jasmineEnv.execute();
            }

        })();
    </script>
</body>

</html>